<?php
//http://localhost/1908php3/goodslist.php接口
@include_once("toubu.php");
$key=$_GET["key"];
$orderby=$_GET["orderby"];
$paixu=$_GET["paixu"];
$sql="SELECT * FROM gucciinfo WHERE goodsname LIKE '%$key%' order by $orderby $paixu ";
$result=mysql_query($sql);//query查询
    $list=array();
    while($item=mysql_fetch_array($result)){
        //echo json_encode($item);//拿到列表所有数据；
        $obj=array();//声明一个空对象，放我想要的数据；
        $obj['id']=$item['id'];
        $obj['goodsname']=$item['goodsname'];
        $obj['goodsnum']=$item['goodsnum'];
        $obj['goodsimg']=$item['goodsimg'];
        $obj['goodsprice']=$item['goodsprice'];
        $list[]=$obj;
        }
       echo json_encode($list);
   
